#ifndef MYTCPSERVER_H
#define MYTCPSERVER_H

#include <QTcpServer>
#include <QTcpServer>
// #include <QList>
#include <QHash>
#include "mytcpsocket.h"
#include "protocol.h"

class MyTcpServer : public QTcpServer
{
    Q_OBJECT
public:
    MyTcpServer();

    static MyTcpServer& getInstance(); //单例模式

    virtual void incomingConnection(qintptr socketDescriptor);

    void resend(const char* user_name, PDU* pdu);

private:
    QHash<MyTcpSocket*, int> m_sock_hash; //后面的int用不到, 传0处理

};

#endif // MYTCPSERVER_H
